package com.cefa.edu.dao;

import com.cefa.edu.pojo.BlockChainData;
import com.cefa.edu.pojo.Grade;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @author huangzehui
 * @date 18-8-15 下午2:09
 */
@Mapper
public interface BlockChainDataMapper {
    @Insert({ "insert into cefa_edu_block_chain_data(data_type,data_id,block_hash,block_height,transaction_hash,chain_time,data_hash) values(#{dataType},#{dataId},#{blockHash},#{blockHeight},#{transactionHash},#{chainTime},#{dataHash})" })
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insertBlockChainData(BlockChainData blockChainData);

    @Select({"select count(cd.id )from cefa_edu_block_chain_data cd where cd.data_id=#{scoreId}"})
    int getBlockChainDataCount(Integer scoreId);
}
